-
-
Notifications
You must be signed in to change notification settings - Fork 195
Sheffield | May-2025 | WALEED-YAHYA SALIH-TAHA | Sprint-2 #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…bug section. 2. corrected the code in the three files.
2. explained the errors messages . 3. corrected the code and fixed the problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
There are also exercises in
Sprint-2/3-mandatory-implement
andSprint-2/4-mandatory-interpret
. -
Can you also include a brief description of your PR under "Changelist"?
-
Why not practice "committing files one by one, on purpose, and for a reason"?
In VSCode, you can select which file to stage, and commit only the staged file.
See: https://www.youtube.com/watch?v=z5jZ9lrSpqk&t=705 (At around 12:50 minute marker, the video shows how to stage a single file).
Sprint-2/1-key-errors/1.js
Outdated
function convertToPercentage(decimalNumber) { | ||
decimalNumber = 0.5; // Remove 'const' to avoid redeclaration | ||
const percentage = `${decimalNumber * 100}%`; | ||
|
||
return percentage; | ||
} | ||
console.log(convertToPercentage(0.5)); // Output: "50%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also execute the following statement to see if it produce the output you expected?
console.log(convertToPercentage(0.1));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it gives me the same result, because the decimalNumber was declared above so the program ignores the (0.1).
I have now removed the value, so it takes what I have wrote down in thee console.log
…rn their body mass.
2. called the function with input string 3. the function returns the string in UPPER_SNAKE_CASE.
…ER_SNAKE_CASE_INPUT
…reusable block of code. 2. declared a function (toPounds) with parameter name. 3. I called the function 3 times.
…reusable block of code. 2. declared a function (toPounds) with parameter name. 3. I called the function 4 times.
2. Answered the questions clearly and excuted the code to see the results.
2. tested the code to see the correct result as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you double check questions (b) and (c) in Sprint-2/4-mandatory-interpret/time-format.js
? I will mark this PR as completed first.
// The value assigned to num when pad is called for the first time is 1. This is because totalHours is calculated as (61 - 1) / 60, which equals 1. | ||
// The first call to pad is for totalHours, which is 1. | ||
|
||
// c) What is the return value of pad is called for the first time? | ||
// =============> write your answer here | ||
// The return value of pad when called for the first time is "01". This is because pad converts the number 1 to a string and pads it with a leading zero to ensure it has at least two digits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer is not 1. You can add a console.log(num);
after line 1 (but before the return statement), and execute the script to find out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I can see now, I found the answer is 0., I updated the answer now.
…d out the value of "num" when pad is called the frist time is 0.
…odule-Structuring-and-Testing-Data into Sprint2-Test-branch
Learners, PR Template
Self checklist
Changelist
I have corrected the errors, debugged and implemented the functions in sprint-2 folder. also interpreted the given codes and tested them as well.
Questions
Ask any questions you have for your reviewer.